import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

public class joinEvent implements Listener {
    @EventHandler
    public void qwq(PlayerJoinEvent event) {
        for (Player otherPlayer :
             Bukkit.getOnlinePlayers()) {
            if (otherPlayer.getDisplayName().contains("隐身")) {
                Player player = otherPlayer.getPlayer();
                if (player != null) {
                    event.getPlayer().hidePlayer(player);
                }
            }
        }
    }
}